package simplepwdkeeper;

import com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel;
import java.io.File;
import java.io.IOException;
import java.util.logging.FileHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

public class Main {

    public static void main(String[] args) {
        // Logger
        try {
            Logger.getLogger("").addHandler(new FileHandler("errorlog.xml"));
        } catch (IOException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SecurityException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        }

        Vars.gtest();

//        // Initialisation
//        Vars.PropFileName = System.getProperty("user.home") + "/.SimplePwdKeeper/Options.xml";
//        File propdir = new File(System.getProperty("user.home") + "/.SimplePwdKeeper");
//        if (!propdir.exists()) {
//            propdir.mkdirs();
//        }
//        // End of initialisation
//
//        // Properties
//        Vars.LoadProperties();
//        if (!Vars.prop.containsKey("DataFile")) {
//            Vars.prop.setProperty("DataFile", System.getProperty("user.home") + "/.SimplePwdKeeper/data");
//            Vars.SaveProperties();
//        }
//        // End of Properties
//
//        // Look and feel
//        try {
//            UIManager.setLookAndFeel(new NimbusLookAndFeel());
//        } catch (UnsupportedLookAndFeelException ex) {
//            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
//        }
//
//        MainFrame frm = new MainFrame();
//        frm.setLocationRelativeTo(null);
//        frm.setVisible(true);
    }
}
